/*--------------------------------------------------------------------------------
 *
 * ===Copyright===
 * Copyright (C) 2006-2008 toge (toge.mail@gmail.com)
  * (See Copyright Notice at COPYRIGHT file)
 *
 * ===Licence===
 * Mit License
 *
 * ===Revision===
 * $Revision: 117 $
 *--------------------------------------------------------------------------------*/
#include <SDL.h>
#include "Constants.h"

using namespace ggl2d;

Constants *Constants::instance_ = 0;

static
unsigned int
keymap[12] = {SDLK_z, SDLK_x, SDLK_c, SDLK_v,
              SDLK_a, SDLK_s, SDLK_d, SDLK_f,
              SDLK_LSHIFT, SDLK_LCTRL, SDLK_SPACE, SDLK_ESCAPE};

static
unsigned char
butmap[12] = {0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, 9u, 10u, 11u};

bool Constants::load()
{
  hoseiSize_ = Vector(100.f, 100.f);

  windowWidth_ = 800;
  windowHeight_ = 600;

  frameSize_  = Vector( 4096,  3072);
  stageSize_  = Vector(frameSize().x() * 9, frameSize().y() * 9);

  initLevel_      = 10;
  textLevel_      = 50;
  fpsLevel_       = 70;
  updateLevel_    = 80;

  checkspan_ = FrameTime(0,  50 * 1000);

  hoseiSpan_ = 0.6f;
  bboxRect_ = Rect(0, 0, 4096.f, 3072.f);
  hoseiSize_ = Vector(1638.4f, 1228.8f);

  hoseiJoystick_ = 0.025f;

  keyboardMap_ = keymap;
  buttonMap_ = butmap;

  doubleClickSpan_ = FrameTime(0, FrameTime::MICROSECOND * 2 / 3);

  return true;
}

